<?php

header('Content-Type: application/json; charset=utf-8');

mysql_connect("localhost","root","root") or die ("Error al conectar!");
mysql_select_db("LeisureTime") or die ("Verifique la base de datos");

$sql = "SELECT * FROM `Categorias`";
$resulset = mysql_query($sql);
$rows = array();
while($fila = mysql_fetch_assoc($resulset)){
	$rows[] = array_map('utf8_encode', $fila);
}

//$prueba = array('0','1', '2');
echo json_encode($rows);
//echo json_encode($prueba);
 
 
?>